Merged
Conversation
kainino0x
approved these changes
Feb 1, 2025
extra.d.ts
Outdated
Comment on lines
+136
to
+115
| interface GPUTexelCopyBufferInfo | ||
| extends GPUTexelCopyBufferLayout { | ||
| /** | ||
| * A buffer which either contains texel data to be copied or will store the texel data being | ||
| * copied, depending on the method it is being passed to. | ||
| */ | ||
| buffer: GPUBuffer; | ||
| } | ||
|
|
||
| interface GPUTexelCopyBufferLayout { | ||
| /** | ||
| * The offset, in bytes, from the beginning of the texel data source (such as a | ||
| * {@link GPUTexelCopyBufferInfo#buffer|GPUTexelCopyBufferInfo.buffer}) to the start of the texel data | ||
| * within that source. | ||
| */ | ||
| offset?: GPUSize64; | ||
| /** | ||
| * The stride, in bytes, between the beginning of each texel block row and the subsequent | ||
| * texel block row. | ||
| * Required if there are multiple texel block rows (i.e. the copy height or depth is more | ||
| * than one block). | ||
| */ | ||
| bytesPerRow?: GPUSize32; | ||
| /** | ||
| * Number of texel block rows per single texel image of the texture. | ||
| * {@link GPUTexelCopyBufferLayout#rowsPerImage} × | ||
| * {@link GPUTexelCopyBufferLayout#bytesPerRow} is the stride, in bytes, between the beginning of each | ||
| * texel image of data and the subsequent texel image. | ||
| * Required if there are multiple texel images (i.e. the copy depth is more than one). | ||
| */ | ||
| rowsPerImage?: GPUSize32; | ||
| } | ||
|
|
||
| interface GPUTexelCopyTextureInfo { | ||
| /** | ||
| * Texture to copy to/from. | ||
| */ | ||
| texture: GPUTexture; | ||
| /** | ||
| * Mip-map level of the {@link GPUTexelCopyTextureInfo#texture} to copy to/from. | ||
| */ | ||
| mipLevel?: GPUIntegerCoordinate; | ||
| /** | ||
| * Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. | ||
| * Together with `copySize`, defines the full copy sub-region. | ||
| */ | ||
| origin?: GPUOrigin3D; | ||
| /** | ||
| * Defines which aspects of the {@link GPUTexelCopyTextureInfo#texture} to copy to/from. | ||
| */ | ||
| aspect?: GPUTextureAspect; | ||
| } | ||
|
|
||
| interface GPUCopyExternalImageDestInfo | ||
| extends GPUTexelCopyTextureInfo { | ||
| /** | ||
| * Describes the color space and encoding used to encode data into the destination texture. | ||
| * This [[#color-space-conversions|may result]] in values outside of the range [0, 1] | ||
| * being written to the target texture, if its format can represent them. | ||
| * Otherwise, the results are clamped to the target texture format's range. | ||
| * Note: | ||
| * If {@link GPUCopyExternalImageDestInfo#colorSpace} matches the source image, | ||
| * conversion may not be necessary. See [[#color-space-conversion-elision]]. | ||
| */ | ||
| colorSpace?: PredefinedColorSpace; | ||
| /** | ||
| * Describes whether the data written into the texture should have its RGB channels | ||
| * premultiplied by the alpha channel, or not. | ||
| * If this option is set to `true` and the {@link GPUCopyExternalImageSourceInfo#source} is also | ||
| * premultiplied, the source RGB values must be preserved even if they exceed their | ||
| * corresponding alpha values. | ||
| * Note: | ||
| * If {@link GPUCopyExternalImageDestInfo#premultipliedAlpha} matches the source image, | ||
| * conversion may not be necessary. See [[#color-space-conversion-elision]]. | ||
| */ | ||
| premultipliedAlpha?: boolean; | ||
| } | ||
|
|
||
| interface GPUCopyExternalImageSourceInfo { | ||
| /** | ||
| * The source of the texel copy. The copy source data is captured at the moment that | ||
| * {@link GPUQueue#copyExternalImageToTexture} is issued. Source size is determined as described | ||
| * by the external source dimensions table. | ||
| */ | ||
| source: GPUCopyExternalImageSource; | ||
| /** | ||
| * Defines the origin of the copy - the minimum (top-left) corner of the source sub-region to copy from. | ||
| * Together with `copySize`, defines the full copy sub-region. | ||
| */ | ||
| origin?: GPUOrigin2D; | ||
| /** | ||
| * Describes whether the source image is vertically flipped, or not. | ||
| * If this option is set to `true`, the copy is flipped vertically: the bottom row of the source | ||
| * region is copied into the first row of the destination region, and so on. | ||
| * The {@link GPUCopyExternalImageSourceInfo#origin} option is still relative to the top-left corner | ||
| * of the source image, increasing downward. | ||
| */ | ||
| flipY?: boolean; | ||
| } |
Collaborator
There was a problem hiding this comment.
Why do all of the copy-related interfaces need to be here? They're in the IDL so I thought they'd be autogenerated.
extra.d.ts
Outdated
| @@ -0,0 +1,253 @@ | |||
| // ********************************************************************************************* | |||
| // This file is manually-edited by diffing against an autogenerated file. See README.md. | |||
Collaborator
There was a problem hiding this comment.
I assume this is here to be pasted into the combined file, but it's confusing because extra.d.ts is meant to be all manually written right? Maybe move this comment into a string in the script?
Contributor
Author
|
revisiting this. PTAL. |
Contributor
Author
|
actually, let me fix the test errors first |
6994d9b to
292d8c9
Compare
kainino0x
approved these changes
Jul 10, 2025
Collaborator
kainino0x
left a comment
There was a problem hiding this comment.
Sorry for the slow review. LGTM, thanks!
Collaborator
|
Hm, test still failed though. |
kainino0x
reviewed
Jul 10, 2025
292d8c9 to
b259ce3
Compare
b259ce3 to
90d145a
Compare
Collaborator
|
whoops, sorry for the race condition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's a version that tries to massage the generated/index.d.ts code closer to the dist/index.d.ts. It also separates out the easy parts into extra.d.ts but rather than have 2 files in dist it preprends the contents when making generated/index.d.ts
wdyt?
note: there's 3 commits. I might be easier to look at the commit diffs than the PR diff